home *** CD-ROM | disk | FTP | other *** search
/ Adobe Graphics & Publishing SDK 1996 December / Adobe Graphics & Publishing SDK 1996 December.iso / pc / ps40sdk / examples / selection / selectorama / common / selectorama.r < prev    next >
Encoding:
Text File  |  1996-11-08  |  6.9 KB  |  307 lines

  1. /*
  2.     File: Selectorama.r
  3.  
  4.     Copyright (c) 1996, Adobe Systems Incorporated.
  5.     All rights reserved.
  6. */
  7.  
  8. /***************************************************************/
  9. /* Defines required by include files */
  10.  
  11. #define plugInName            "Selectorama"
  12. #define VersionString        "4.0"
  13.  
  14. /***************************************************************/
  15.  
  16. #if Macintosh
  17. #include "Types.r"
  18. #include "SysTypes.r"
  19. #include "PIGeneral.r"
  20. #include "PIUtilities.r"
  21. #incldue "DialogUtilities.r"
  22. #endif
  23.  
  24. #if MSWindows
  25. #include "PIGeneral.h"
  26. #include "PIUtilities.r"
  27. #include "WinDialogUtils.r"
  28. #endif
  29.  
  30. #include "PIActions.h"
  31.  
  32. /********************************************************************************/
  33.  
  34. #define plugInComment         "selectorama example selection plug-in"
  35. #define vendorName            "AdobeSDK"
  36.  
  37. #define ourSuiteID            'sdK7'
  38. #define ourClassID            ourSuiteID
  39. #define ourEventID            'selM'
  40. #define selectMin            'seL0'
  41. #define selectMax            'seL1'
  42. #define selectRandom        'shL2'
  43. #define useTarget            'useT'
  44. #define useMerged            'useM'
  45. #define typeSelect            'tseL'
  46. #define typeComposite        'tcoM' // targetCompositeChannels, mergedCompositeChannels
  47. #define keyCreate            'kcrE'
  48. #define typeCreate            'tcrE'
  49. #define    createSelection        'crE0'
  50. #define createMaskpath        'crE1'
  51. #define createLayer            'crE2'
  52.  
  53. #define errCantCreatePath    16989
  54.  
  55. /*************************************************************/
  56.  
  57. resource 'PiPL' (ResourceID, purgeable)
  58. {
  59.     {
  60.     Kind { Selection },
  61.     Name { plugInName "..." },
  62.     Category { vendorName },
  63.     Version { (latestSelectionVersion << 16) | latestSelectionSubVersion },
  64.  
  65.     HasTerminology { ourClassID, ourEventID, ResourceID, "" },
  66.     /* classID, eventID, aete ID, uniqueString */
  67.  
  68.     EnableInfo { "true" },
  69.  
  70.     #if Macintosh
  71.     Code68K { Selection, $$ID },
  72.     CodePowerPC { 0, 0, "" },
  73.     #endif
  74.     
  75.     #if MSWindows
  76.     CodeWin32X86 { "ENTRYPOINT" },
  77.     #endif
  78.     }
  79. };
  80.  
  81. /* About resources */
  82.  
  83. resource StringResource (AboutID, "About Text", purgeable)
  84. {
  85.     plugInName "\n\n"
  86.     "Version " VersionString " "
  87.     "Release " ReleaseString "\n"
  88.     "Copyright ⌐ 1996, Adobe Systems Incorporated.\n"
  89.     "All rights reserved.\n\n"
  90.     "An example plug-in selection module for Adobe Photoshop¿."
  91. };
  92.  
  93. /* Error strings */
  94.  
  95. resource StringResource (errCantCreatePath, "No paths", purgeable)
  96. {
  97.     "paths cannot be made from pixel selections"
  98. };
  99.  
  100. /* Parameters Dialog */
  101.  
  102. resource 'DLOG' (ResourceID+1, "UI", purgeable)
  103. {
  104.     {259, 337, 383, 729},
  105.     movableDBoxProc,
  106.     visible,
  107.     noGoAway,
  108.     0x0,
  109.     ResourceID+1,
  110.     plugInName
  111. };
  112.  
  113. resource 'DITL' (ResourceID+1, "UI", purgeable)
  114. {
  115.     {    /* array DITLarray: 16 elements */
  116.         /* [1] */
  117.         {8, 312, 28, 380},
  118.         Button {
  119.             enabled,
  120.             "OK"
  121.         },
  122.         /* [2] */
  123.         {36, 315, 56, 379},
  124.         Button {
  125.             enabled,
  126.             "Cancel"
  127.         },
  128.         /* [3] */
  129.         {8, 35, 36, 76},
  130.         StaticText {
  131.             disabled,
  132.             "Area:"
  133.         },
  134.         /* [4] */
  135.         {8, 79, 24, 183},
  136.         RadioButton {
  137.             enabled,
  138.             "Minimum"
  139.         },
  140.         /* [5] */
  141.         {24, 79, 40, 183},
  142.         RadioButton {
  143.             enabled,
  144.             "Maximum"
  145.         },
  146.         /* [6] */
  147.         {40, 79, 56, 159},
  148.         RadioButton {
  149.             enabled,
  150.             "Random"
  151.         },
  152.         /* [7] */
  153.         {40, 167, 64, 231},
  154.         StaticText {
  155.             disabled,
  156.             "Amount:"
  157.         },
  158.         /* [8] */
  159.         {39, 235, 56, 264},
  160.         EditText {
  161.             enabled,
  162.             "50"
  163.         },
  164.         /* [9] */
  165.         {40, 267, 64, 287},
  166.         StaticText {
  167.             disabled,
  168.             "%"
  169.         },
  170.         /* [10] */
  171.         {72, 7, 100, 77},
  172.         StaticText {
  173.             disabled,
  174.             "Channels:"
  175.         },
  176.         /* [11] */
  177.         {72, 79, 88, 160},
  178.         RadioButton {
  179.             enabled,
  180.             "Target"
  181.         },
  182.         /* [12] */
  183.         {88, 79, 104, 160},
  184.         RadioButton {
  185.             enabled,
  186.             "Merged"
  187.         },
  188.         /* [13] */
  189.         {72, 171, 100, 228},
  190.         StaticText {
  191.             disabled,
  192.             "Create:"
  193.         },
  194.         /* [14] */
  195.         {72, 227, 88, 331},
  196.         RadioButton {
  197.             enabled,
  198.             "Selection"
  199.         },
  200.         /* [15] */
  201.         {88, 227, 104, 331},
  202.         RadioButton {
  203.             enabled,
  204.             "Path"
  205.         },
  206.         /* [16] */
  207.         {104, 227, 120, 331},
  208.         RadioButton {
  209.             enabled,
  210.             "Layer"
  211.         }
  212.     }
  213. };
  214.  
  215. /* Scripting dictionary resource */
  216.  
  217. resource 'aete' (ResourceID, purgeable)
  218. {
  219.     1, 0, english, roman,                    /* aete version and language specifiers */
  220.     {
  221.         vendorName,                            /* vendor suite name */
  222.         "Adobe example plug-ins",            /* optional description */
  223.         ourSuiteID,                            /* suite ID */
  224.         1,                                    /* suite code, must be 1 */
  225.         1,                                    /* suite level, must be 1 */
  226.         {                                    /* structure for filters */
  227.             vendorName " selectorama",        /* unique selection name */
  228.             "selectorama plug-in",            /* optional description */
  229.             ourClassID,                        /* class ID, must be unique or Suite ID */
  230.             ourEventID,                        /* event ID, must be unique */
  231.  
  232.             NO_REPLY,                        /* never a reply */
  233.             IMAGE_DIRECT_PARAMETER,            /* direct parameter, used by Photoshop */
  234.             {                                                /* parameters here, if any */
  235.                 "select area",                                /* parameter name */
  236.                 keyArea,                                    /* parameter key ID */
  237.                 typeSelect,                                    /* parameter type ID */
  238.                 "selection area",                            /* optional description */
  239.                 flagsEnumeratedParameter,                    /* parameter flags */
  240.                 
  241.                 "amount",                                    /* parameter name */
  242.                 keyAmount,                                    /* parameter key ID */
  243.                 typeFloat,                                    /* parameter type ID */
  244.                 "random amount",                            /* optional description */
  245.                 flagsSingleParameter,                        /* parameter flags */
  246.  
  247.                 "use channels from",                        /* parameter name */
  248.                 keyChannels,                                /* key ID */
  249.                 typeComposite,                                /* type ID */
  250.                 "use composite target or merged",            /* optional descript */
  251.                 flagsEnumeratedParameter,
  252.                 
  253.                 "create",                                    /* parameter name */
  254.                 keyCreate,                                    /* parameter key ID */
  255.                 typeCreate,                                    /* parameter type ID */
  256.                 "create type",                                /* optional description */
  257.                 flagsEnumeratedParameter                    /* parameter flags */
  258.  
  259.  
  260.             }
  261.         },
  262.         {},    /* non-filter plug-in class here */
  263.         {}, /* comparison ops (not supported) */
  264.         {                                                    /* enumerations */
  265.             typeSelect,                                        /* type select 'tseL' */
  266.             {
  267.                 "minimum",                                    /* first value */
  268.                 selectMin,                                     /* 'seL0' */
  269.                 "select minimum",                            /* optional description */
  270.                 
  271.                 "maximum",                                    /* second value */
  272.                 selectMax,                                    /* 'seL1' */
  273.                 "select maximum",                            /* optional description */
  274.  
  275.                 "random",                                    /* third value */
  276.                 selectRandom,                                 /* 'seL2' */
  277.                 "select random"                                /* optional description */
  278.             },
  279.             
  280.             typeComposite,                                    /* type 'tcoM' */
  281.             {
  282.                 "target",                                    /* use target composite */
  283.                 useTarget,                                    /* 'useT' */
  284.                 "use target composite",                        /* optional descript */
  285.                 
  286.                 "merged",                                    /* use merged channels */
  287.                 useMerged,                                    /* 'useM' */
  288.                 "use merged composite"                        /* optional descript */
  289.             },
  290.  
  291.             typeCreate,                                        /* type shape 'tshP' */
  292.             {
  293.                 "selection",                                /* first value */
  294.                 createSelection,                             /* 'crE0' */
  295.                 "make selection",                            /* optional description */
  296.                 
  297.                 "mask path",                                /* second value */
  298.                 createMaskpath,                                /* 'crE1' */
  299.                 "make mask path",                            /* optional description */
  300.  
  301.                 "layer",                                    /* third value */
  302.                 createLayer,                                 /* 'crE2' */
  303.                 "make layer"                                /* optional description */
  304.             }            
  305.         }    /* other enumerations */
  306.     }
  307. };